class City < ActiveRecord::Base
  self.table_name = "sharp_zones_cities"
  attr_protected
  has_many :directories
  has_many :categories, :through => :directories
end

class Directory < ActiveRecord::Base
  belongs_to :city
end

class RenameCityIdToCity < ActiveRecord::Migration
  def up
    add_column :directories, :city_name, :string
    Directory.all.each do |directory|
      directory.update_attributes city_name: directory.city.name
    end
  end

  def down
  end
end
